<?php

class Admin extends My_Controller
{
    function index()
    {

        if($this->session->userdata('role') == 1 || $this->session->userdata('role') == 3 ) {
        $warning = $this->m_item->lay_item_warning() ;
        if($warning) {
        $data['warning'] = $warning ; }
            else $data['warning'] = '';
        $invoice_chuaxuly = $this->m_invoice->invoice_khong_phan_trang_chua_xu_ly();
        if($invoice_chuaxuly) {
        $data['invoice_chuaxuly'] = $invoice_chuaxuly ; }
        else $data['invoice_chuaxuly'] = '';
        $data['saleoffchung'] = $this->m_item->get_new_saleoff_chung();
        $this->load->view('admin_layout/index',$data);
        } else redirect('account/login_admin');
    }
}